<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

    <div id="container"></div>
    <button id="btnAdopt">adoptNode</button>

    <iframe id="ifr" src="./1.6 生命周期 + 属性接受.html">

    </iframe>

    <script type="text/javascript">
        btnAdopt.addEventListener("click", function (e) {

            const textNode = ifr.contentWindow.document.getElementById("myText");

            container.appendChild(document.adoptNode(textNode))
        })
    </script>
</body>

</html>